/*
 * Project it.battlehorse.rcp.tools
 * Created on May 13, 2006
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * A copy of the LGPL is available also at
 * http://www.gnu.org/copyleft/lesser.html
 * 
 */ 
package it.battlehorse.rcp.tools.actors;

import java.util.List;

import org.eclipse.core.runtime.CoreException;

/**
 * This interface is used to store and retrieve informations about the available actors
 * registered on the platform.
 * 
 * @author battlehorse
 * @since May 13, 2006
 */
public interface IActorRegistry {

	/**
	 * Returns the list of known actors, as read from the plugin configuration files. 
	 * Even the actors marked with {@code visible = false } are returned by this method.
	 * 
	 * @return the list of known actors, as read from the plugin configuration files.
	 */
	public List<ActorDescriptor> getKnownActorConfiguration();

	/**
	 * Returns the list of known actors, as read from the plugin configuration files, optionally
	 * filtering the ones marked with the option {@code visible = false}. 
	 * 
	 * @param limitOnlyVisibles decides if the actors marked with the option {@code visible = false} have 
	 * 		to be returned or not.
	 * @return the list of known actors
	 */
	public List<ActorDescriptor> getKnownActorConfiguration(
			boolean limitOnlyVisibles);
	
	/**
	 * Returns the actor implementation associated with a given actor id. This method
	 * returns null if the actor id is not among the known ones.
	 * 
	 * @param actorId the actor id
	 * @return the actor implementation
	 * @throws CoreException if the instantiation of the actor fails
	 */
	public IActor getActorClassForActorId(String actorId) throws CoreException;

	/**
	 * Returns the actor descriptor which describes an Actor, given its
	 * associated view id.
	 * 
	 * @param viewId the id of the view associated with the Actor
	 * @return the actor descriptor which describes the actor, or {@code null}
	 * 	if the given viewId was not found within the ones known to the platform
	 */
	public ActorDescriptor getActorForView(String viewId);

	/**
	 * Returns the actor descriptor which describes an Actor, given its
	 * associated id.
	 * 
	 * @param actorId the id of associated to the Actor
	 * @return the actor descriptor which describes the actor, or {@code null}
	 * 	if the given actorId was not found within the ones known to the platform
	 */
	public ActorDescriptor getActorForActorId(String actorId);

}